import request from "./request";

// 用户数据列表
export const getUserList = (params) => {
  return request({
    url: "users",
    params
  });
};

// 修改用户状态
export const changeUserType = (uId, type) => {
  return request({
    url: `users/${uId}/state/${type}`,
    method: "put"
  });
};

// 添加用户
export const addUsers = (data) => {
  return request({
    url: "users",
    method: "post",
    data
  });
};

// 编辑用户
export const editUsers = (data) => {
  return request({
    url: `/users/${data.id}`,
    method: "put",
    data
  });
};

// 删除用户
export const deleteUsers = (id) => {
  return request({
    url: `/users/${id}`,
    method: "delete"
  });
};
